<?php


namespace App\Models;


use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use LAuth\Models\User;

/**
 * Class Picking
 * @package App\Models
 * @property Collection $detail
 * @property Collection $order
 * @author luffyzhao@vip.126.com
 */
class Picking extends Model
{
    protected $table = 'picking';
    protected $fillable = ['code', 'type', 'count'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     * @author luffyzhao@vip.126.com
     */
    public function order(){
        return $this->hasMany(PickingOrder::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     * @author luffyzhao@vip.126.com
     */
    public function detail(){
        return $this->hasMany(PickingDetail::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function logs(){
        return $this->hasMany(PickingLog::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @author luffyzhao@vip.126.com
     */
    public function user(){
        return $this->belongsTo(User::class);
    }

}
